<%@page import="java.util.Map"%>
<%@page import="java.util.List"%>
<%@page import="java.sql.Connection"%>
<%@page import="by.epam.communalservices.dao.jdbc.JdbcDaoJkhTeam"%>
<%@page import="by.epam.communalservices.entity.JkhTeam"%>



<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib tagdir="/WEB-INF/tags/connect" prefix="connect"%>
<%@ taglib tagdir="/WEB-INF/tags/team" prefix="team"%>
<%@ taglib tagdir="/WEB-INF/tags/table" prefix="table"%>

<connect:isset/>
<connect:denny rules="admin,view,team_view,kadrovik,brigadir,tasker" />

<connect:display rules="admin,view,team_view,kadrovik">
	<team:list/>
</connect:display>
<connect:display rules="brigadir">
	<team:list owner="${sessionScope.currentUser.id}" />
</connect:display>

<table:body style="width:95%;">
	<table:title span="9">
	   Team list!!!
	</table:title>
	<table:head names="id,surname,name,patronymic,count,owner,newtask,rating,actions" />
	<c:set var="index" value="0" />
	<c:forEach items="${requestScope.teamList}" var="team">
		<c:set var="index" value="${index + 1}" />
		<team:line team="${team}" dif="${index mod 2 eq 0 ? 'c' : 'n'}" />	
	</c:forEach>

	<table:title span="9" down="yes">
		<connect:display rules="admin,team_edit,edit,kadrovik">
			<button onclick="document.location.href='team_edit'"
				style='float: right;'>Add New Team</button>
		</connect:display>
	</table:title>
</table:body>
